home *** CD-ROM | disk | FTP | other *** search
/ Computer Life: SuperPac / SuperPac (Computer Life Magazine)(Ziff-Davis)(1995).ISO / pc / demos / vguitar / vgdemo.mst < prev    next >
Encoding:
Text File  |  1994-11-22  |  20.9 KB  |  845 lines

  1. '***********************************************
  2. '*   Virtual Guitar Demo for "Computer Life"   *
  3. '***********************************************
  4.  
  5. '$INCLUDE 'setupapi.inc'
  6. '$INCLUDE 'vmmsdet.inc'
  7. '$INCLUDE 'vminsapi.inc'
  8.  
  9. ''Dialog ID's
  10. CONST DLG_WELCOME%            = 100
  11. CONST DLG_INSTPATH%           = 110
  12. CONST DLG_ALREADYINSTALLED%   = 140
  13. CONST DLG_DIRNOTFOUND%        = 160
  14. CONST DLG_NEED486%            = 180
  15. CONST DLG_NEEDWIN31%          = 190
  16. CONST DLG_NEEDENHANCED%       = 200
  17. CONST DLG_NEED4MEG%           = 210
  18. CONST DLG_NEED5MBDISKSPACE%   = 220
  19. CONST DLG_NEEDVFW11%          = 260
  20. CONST DLG_REALLYEXIT%         = 270
  21. CONST DLG_PROGRAMGROUP%       = 280
  22. CONST DLG_SELECTGROUP%        = 290
  23. CONST DLG_INVALIDPATH%        = 310
  24. CONST DLG_INVALIDDRIVE%       = 320
  25. CONST DLG_NEEDDOSV50%         = 330
  26. CONST DLG_CDROMDRIVE%         = 350
  27. CONST DLG_SKIPFRAMESDISABLED% = 440
  28. CONST DLG_SETUPDONE%          = 450
  29. CONST DLG_RECOMMEND640X480%   = 460
  30. CONST DLG_NEEDWAVE%           = 500
  31. CONST DLG_CALLERROR%          = 510
  32. CONST DLG_DIRNOTWRITABLE%     = 590
  33. CONST DLG_NEWGROUP%           = 680
  34. CONST DLG_NEED640X480%        = 780
  35. CONST DLG_NEED256COLOR%       = 800
  36. CONST DLG_DEFVIDNOTWINDOW%    = 830
  37.  
  38. ''Error return values for GetSoundCardInfo()
  39. CONST GSCI_SUCCESS%              = 0
  40.  
  41. ''Bitmap ID
  42. CONST DEMOLOGO% = 1
  43.  
  44. ''Misc constants
  45. CONST VALIDCHAR$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\"
  46. CONST CUIDLL$ = "vminst.dll"
  47. CONST EMPTY$ = ""
  48. CONST DEFINSTPATH$ = "C:\VGDEMO\"
  49. CONST VGD$ = "Virtual Guitar Demo"
  50. CONST FALSE% = 0
  51. CONST TRUE% = -1
  52. CONST YES$ = "Yes"
  53. CONST NO$ = "No"
  54. CONST UYES$ = "YES"
  55. CONST UNO$ = "NO"
  56.  
  57. ''Dialog box routines
  58. CONST INFODLG$ = "FInfoDlgProc"
  59. CONST EDITDLG$ = "FEditDlgProc"
  60. CONST TEXTDLG$ = "FTwoTextDlgProc"
  61. CONST LISTDLG$ = "FListDlgProc"
  62.  
  63. ''Dialog box answer strings
  64. CONST DSTOP$ = "STOP"
  65. CONST CONTINUE$ = "CONTINUE"
  66. CONST CHANGE$ = "CHANGE"
  67. CONST CREATE$ = "CREATE"
  68. CONST DESTROY$ = "DESTROY"
  69. CONST TRYAGAIN$ = "TRYAGAIN"
  70.  
  71. ''Sections in VMUSIC.INI
  72. CONST DEVICES$ = "Devices"
  73. CONST VMSB$ = "VMSB"
  74. CONST INSTALLATION$ = "Installation"
  75. CONST VMSERIAL$ = "VMSerial"
  76. CONST VGDEMO$ = "VGDEMO"
  77. CONST GUITAR$ = "Guitar"
  78. CONST VMMSND$ = "VMMSND"
  79.  
  80. ''Internal functions
  81. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  82. DECLARE FUNCTION CreatePath (szPath$) AS INTEGER
  83. DECLARE FUNCTION VerifyPath (szPath$) AS INTEGER
  84. DECLARE FUNCTION VerifyDrive(szDrv$)  AS INTEGER
  85.  
  86. ''Subroutines
  87. DECLARE SUB DoSystemTests
  88. DECLARE SUB GetCDDrive
  89. DECLARE SUB GetInstallPath
  90. DECLARE SUB CheckWaveDevice
  91. DECLARE SUB UpdateWININI
  92. DECLARE SUB CheckVFW11
  93. DECLARE SUB UpdateVMGroup
  94. DECLARE SUB AskQuit
  95. DECLARE SUB UpdateCDPath
  96. DECLARE SUB UpdateInstallPath
  97. DECLARE SUB InstallVMIcons
  98.  
  99. ''Global variables - needed because they are used across SUBs
  100. GLOBAL InstPath$, VMusicIniPath$
  101. GLOBAL CDDrv$, CDRoot$, HDDrv$
  102. GLOBAL Group$, VidTestFile$
  103. GLOBAL WinIniUpd%, SystemIniUpd%, VMMSNDInstall%, EnableSkipFrames%
  104.  
  105. ''<><><><><><><>   M A I N   P R O G R A M   <><><><><><><><>
  106.  
  107. INIT:
  108.    SetBitmap CUIDLL$, DEMOLOGO%
  109.    SetTitle "Virtual Guitar Demo Installation"
  110.    SetAbout "Virtual Guitar Demo", "Copyright 1994 Ahead, Inc."
  111.  
  112.    Tmp$ = GetSymbolValue("STF_SRCINFPATH")
  113.    IF Tmp$ = EMPTY$ THEN
  114.       Tmp$ = GetSymbolValue("STF_CWDDIR") + "VGDEMO.INF"
  115.    END IF
  116.    ReadInfFile Tmp$
  117.  
  118.    WinDir$ = GetWindowsDir()
  119.    VMusicIniPath$ = MakePath(WinDir$, "VMUSIC.INI")
  120.  
  121.    InstPath$ = DEFINSTPATH$
  122.  
  123. ''See if it's already installed
  124. CHKREINST:
  125.    IF DoesIniSectionExist(VMusicIniPath$, VGDEMO$) THEN
  126.       Tmp$ = UIStartDlg(CUIDLL$, DLG_ALREADYINSTALLED%, INFODLG$, 0, EMPTY$)
  127.       IF Tmp$ = DSTOP$ THEN
  128.          AskQuit
  129.          GOTO CHKREINST
  130.       ELSE
  131.          UIPop 1
  132.       END IF
  133.    END IF
  134.  
  135. ''*******************************************************
  136. ''**      I N S T A L L   o r   R E I N S T A L L      **
  137. ''*******************************************************
  138.  
  139. WELCOME:
  140.     Tmp$ = UIStartDlg(CUIDLL$, DLG_WELCOME%, INFODLG$, 0, EMPTY$)
  141.     IF Tmp$ = CONTINUE$ THEN
  142.         UIPop 1
  143.     ELSE
  144.         AskQuit
  145.         GOTO WELCOME
  146.     END IF
  147.  
  148.    ''Get the CD drive letter and make sure it's wholesome and clean
  149.    GetCDDrive
  150.  
  151.    ''See if VfW V1.1 is installed.  If not, we don't come back.
  152.    CheckVFW11
  153.  
  154.    ''Get the installation path and make sure it's kosher.
  155.    GetInstallPath
  156.  
  157.    ''See if there's a Wave device
  158.    CheckWaveDevice
  159.  
  160.    ''Do System Suitability Tests
  161.    DoSystemTests
  162.  
  163.    ''Now, do the actual installation!
  164.    IF CreatPath% THEN
  165.       I% = CreatePath(InstPath$)
  166.    END IF
  167.  
  168.    ClearCopyList
  169.    AddSectionFilesToCopyList VGDEMO$, CDRoot$, InstPath$
  170.    AddSectionFilesToCopyList "Win", CDRoot$, WinDir$
  171.  
  172.    CopyFilesInCopyList
  173.  
  174.    ''Update VMUSIC.INI
  175.    UpdateCDPath
  176.    UpdateInstallPath
  177.  
  178.    ''Update WIN.INI
  179.    UpdateWININI
  180.  
  181.    ''Create or update a Program Manager group with our stuff
  182.    InstallVMIcons
  183.  
  184. DONE:
  185.    Tmp$ = "To run the Demo, exit from the Super Pac shell and "
  186.    Tmp$ = Tmp$ + "select the Virtual Guitar Demo icon in the "
  187.    Tmp$ = Tmp$ + Group$ + " group."
  188.  
  189.    SetSymbolValue "Text1In", Tmp$
  190.    SetSymbolValue "Text2In", EMPTY$
  191.  
  192.    Tmp$ = UIStartDlg(CUIDLL$, DLG_SETUPDONE%, TEXTDLG$, 0, EMPTY$)
  193.    END
  194.  
  195. QUIT:       ''I don't know why this has to be here, but it does!
  196.    END
  197.  
  198.  
  199. '**
  200. '** Purpose:
  201. '**     Appends a file name to the end of a directory path,
  202. '**     inserting a backslash character as needed.
  203. '** Arguments:
  204. '**     szDir$  - full directory path (with optional ending "\")
  205. '**     szFile$ - filename to append to directory
  206. '** Returns:
  207. '**     Resulting fully qualified path name.
  208. '*************************************************************************
  209. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  210.     IF szDir$ = EMPTY$ THEN
  211.         MakePath = szFile$
  212.     ELSEIF szFile$ = EMPTY$ THEN
  213.         MakePath = szDir$
  214.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  215.         MakePath = szDir$ + szFile$
  216.     ELSE
  217.         MakePath = szDir$ + "\" + szFile$
  218.     END IF
  219. END FUNCTION
  220.  
  221.  
  222.  
  223. '** FUNCTION CreatePath
  224. '**
  225. '** Purpose:
  226. '**   Creates a user-supplied path.
  227. '** Argument:
  228. '**   szPath$ - the path to be created.  If it has multiple subdirectories,
  229. '**      all of them will be created in order.  NOTE: This function assumes
  230. '**      that the character set and syntax of the pathname have already been
  231. '**      validated.
  232. '** Returns:
  233. '**   Always returns 0.
  234. '*************************************************************************
  235. FUNCTION CreatePath (szPath$) STATIC AS INTEGER
  236.  
  237.    '' Put on a trailing "\" if there's not one already
  238.    IF MID$(szPath$, LEN(szPath$), 1) <> "\" THEN
  239.       szPath$ = szPath$ + "\"
  240.    END IF
  241.  
  242.    '' Start the search after the "<drive>:\"
  243.    S% = 4
  244.    I% = INSTR(S%, szPath$, "\")
  245.  
  246.    '' Plow through the list, creating the directories
  247.    WHILE I%
  248.       CreateDir MID$(szPath$, 1, I% - 1), cmoVital
  249.       S% = I% + 1
  250.       I% = INSTR(S%, szPath$, "\")
  251.    WEND
  252.  
  253.    CreatePath = 0    '' Success
  254.  
  255. END FUNCTION
  256.  
  257.  
  258.  
  259. '** FUNCTION VerifyPath
  260. '**
  261. '** Purpose:
  262. '**   Checks a user-supplied path name for correct format and valid
  263. '**   characters.
  264. '** Argument:
  265. '**   szPath$ - the path name to be checked
  266. '** Returns:
  267. '**   0 = path name was OK
  268. '**   1 = no or invalid drive letter
  269. '**   2 = no ":\" following drive letter
  270. '**   3 = invalid character in path name
  271. '**   4 = a directory name was too long or null
  272. '*************************************************************************
  273. FUNCTION VerifyPath (szPath$) STATIC AS INTEGER
  274.  
  275.    '' Assume no errors to start with.
  276.    VerifyPath = 0
  277.  
  278.    ''Make sure it's the proper length
  279.    IF LEN(szPath$) < 3 THEN
  280.       VerifyPath = 4
  281.       EXIT FUNCTION
  282.    END IF
  283.  
  284.    '' See if the drive letter is valid
  285.    IF VerifyDrive(MID$(szPath$, 1, 1)) THEN
  286.       VerifyPath = 1
  287.       EXIT FUNCTION
  288.    END IF
  289.  
  290.    '' After the drive letter should come ":\"
  291.    IF MID$(szPath$, 2, 2) <> ":\" THEN
  292.       VerifyPath = 2
  293.       EXIT FUNCTION
  294.    END IF
  295.  
  296.    L% = LEN(szPath$)
  297.    C% = 0
  298.  
  299.    FOR I% = 4 TO L%
  300.       T$ = MID$(szPath$, I%, 1)
  301.  
  302.       IF INSTR(1, VALIDCHAR$, T$) = 0 THEN
  303.          VerifyPath = 3
  304.          EXIT FOR
  305.       END IF
  306.  
  307.       IF T$ = "\" THEN
  308.          IF C% = 0 THEN
  309.             VerifyPath = 4
  310.             EXIT FOR
  311.          ELSE
  312.             C% = 0
  313.          END IF
  314.       ELSE
  315.          C% = C% + 1
  316.          IF C% > 8 THEN
  317.             VerifyPath = 4
  318.             EXIT FOR
  319.          END IF
  320.       END IF
  321.  
  322.    NEXT I%
  323.  
  324. END FUNCTION
  325.  
  326.  
  327. '** FUNCTION VerifyDrive
  328. '**
  329. '** Purpose:
  330. '**   Checks a user-supplied drive name to see if it is valid and
  331. '**   exists on this system
  332. '** Argument:
  333. '**   szDrv$ - the path name to be checked
  334. '** Returns:
  335. '**   0 = drive name was OK
  336. '**   1 = drive name was invalid
  337. '**   2 = drive does not exist on this system
  338. '*************************************************************************
  339. FUNCTION VerifyDrive (szDrv$) STATIC AS INTEGER
  340.  
  341.    IF LEN(szDrv$) = 1 THEN
  342.       C% = ASC(szDrv$)
  343.       IF C% >= ASC("A") AND C% <= ASC("Z") THEN
  344.          IF IsDriveValid(CHR$(C%)) THEN
  345.             VerifyDrive = 0
  346.          ELSE
  347.             VerifyDrive = 2
  348.          END IF
  349.       ELSE
  350.          VerifyDrive = 1
  351.       END IF
  352.    ELSE
  353.       VerifyDrive = 1
  354.    END IF
  355.  
  356. END FUNCTION
  357.  
  358. ''**
  359. ''**  SUB DoSystemTests
  360. ''**     Performs System Suitability testing
  361. ''**
  362. ''**  Here, we test to make sure their system is adequate for the task.
  363. ''**  In general, our attitude is that if we find something wrong, we let
  364. ''**  the user know about it, but do not prevent him/her from installing.
  365. ''**
  366. ''**  We require the following:
  367. ''**     486 25 MHz or faster processor
  368. ''**     4 MB of RAM
  369. ''**     5 MB of available disk space
  370. ''**     MS Windows V3.1 or later, running in Enhanced mode
  371. ''**     MS DOS V5.0 or later
  372. ''**
  373. ''**  Global inputs:
  374. ''**     HDDrv$
  375. ''**     VidTestFile$
  376. ''**
  377. ''**  Global outputs:
  378. ''**     CPUType%
  379. ''**     SysMemSize&
  380. ''**     EnableSkipFrames%
  381. ''**
  382. STATIC SUB DoSystemTests
  383.  
  384. '' Check for MS-DOS V5.0 or later
  385. SYSTST2:
  386.    IF GetDOSMajorVersion() < 5 THEN
  387.       Tmp$ = UIStartDlg(CUIDLL$, DLG_NEEDDOSV50%, INFODLG$, 0, EMPTY$)
  388.       END
  389.    END IF
  390.  
  391. '' Check for MS Windows V3.1 or later, running in Enhanced mode
  392. SYSTST3:
  393.    MajVer% = GetWindowsMajorVersion()
  394.    MinVer% = GetWindowsMinorVersion()
  395.  
  396.    IF MajVer% < 3 OR (MajVer% = 3 AND MinVer% < 10) THEN
  397.       Tmp$ = UIStartDlg(CUIDLL$, DLG_NEEDWIN31%, INFODLG$, 0, EMPTY$)
  398.       END
  399.    END IF
  400.  
  401. SYSTST4:
  402.    IF GetWindowsMode() <> 2 THEN
  403.       Tmp$ = UIStartDlg(CUIDLL$, DLG_NEEDENHANCED%, INFODLG$, 0, EMPTY$)
  404.       END
  405.    END IF
  406.  
  407. '' Check for a 486 or later processor (we don't check the speed).
  408. SYSTST5:
  409.    CPUType% = GetProcessorType()
  410.    IF CPUType% < 4 THEN
  411.       Tmp$ = UIStartDlg(CUIDLL$, DLG_NEED486%, INFODLG$, 0, EMPTY$)
  412.       END
  413.    END IF
  414.  
  415. '' Check for RAM and disk space
  416. SYSTST6:
  417.    SysMemSize& = GetSystemMemSize()
  418.  
  419.    IF SysMemSize& < 3172 THEN    ''3172 is (3 * 1024K) + 640K
  420.       Tmp$ = UIStartDlg(CUIDLL$, DLG_NEED4MEG%, INFODLG$, 0, EMPTY$)
  421.       END
  422.    END IF
  423.  
  424. SYSTST7:
  425.    IF GetFreeSpaceForDrive(HDDrv$) < (5 * 1048576) THEN
  426.       Tmp$ = UIStartDlg(CUIDLL$, DLG_NEED5MBDISKSPACE%, INFODLG$, 0, EMPTY$)
  427.       END
  428.    END IF
  429.  
  430. '' See if "SkipFrames" is enabled
  431. SYSTST10:
  432.    Tmp$ = GetIniKeyString("WIN.INI", "MCIAVI", "SkipFrames")
  433.    IF Tmp$ = "0" THEN  ''If =1, or if not present, SkipFrames is enabled
  434.       Tmp$ = UIStartDlg(CUIDLL$, DLG_SKIPFRAMESDISABLED%, INFODLG$, 0, EMPTY$)
  435.       IF Tmp$ = CONTINUE$ THEN
  436.          EnableSkipFrames% = 0
  437.          UIPop 1
  438.       ELSEIF Tmp$ = CHANGE$ THEN
  439.          EnableSkipFrames% = -1
  440.          UIPop 1
  441.       ELSE
  442.          AskQuit
  443.          GOTO SYSTST10
  444.       END IF
  445.    END IF
  446.  
  447. '' See if "DefaultVideo" is set to "Window".  Unlike our other changes,
  448. '' this one is necessary for the installation to run and so must be
  449. '' done here and now.
  450. ''
  451.    IF DoesIniKeyExist("WIN.INI", "MCIAVI", "DefaultVideo") THEN
  452.       Tmp$ = GetIniKeyString("WIN.INI", "MCIAVI", "DefaultVideo")
  453.       IF UCASE$(Tmp$) <> "WINDOW" THEN
  454.          Tmp$ = UIStartDlg(CUIDLL$, DLG_DEFVIDNOTWINDOW%, INFODLG$, 0, EMPTY$)
  455.          IF Tmp$ = CHANGE$ THEN
  456.             UIPop 1
  457.             CreateIniKeyValue "WIN.INI", "MCIAVI", "DefaultVideo", "Window", cmoOverwrite
  458.          ELSE
  459.             END
  460.          END IF
  461.       END IF
  462.    END IF
  463.  
  464. '' Check for 640x480 display
  465. SYSTST12:
  466.    I%  = GetScreenWidth()
  467.    I1% = GetScreenHeight()
  468.  
  469.    IF (I% < 640) OR (I1% < 480) THEN
  470.       Tmp$ = UIStartDlg(CUIDLL$, DLG_NEED640X480%, INFODLG$, 0, EMPTY$)
  471.       END
  472.    END IF
  473.  
  474.    IF (I% <> 640) OR (I1% <> 480) THEN
  475.       Tmp$ = UIStartDlg(CUIDLL$, DLG_RECOMMEND640X480%, INFODLG$, 0, EMPTY$)
  476.       UIPop 1
  477.    END IF
  478.  
  479. '' Check for 256-color display
  480. SYSTST13:
  481.    I% = GetDisplayColorBits(HwndFrame())
  482.  
  483.    IF I% < 8 THEN
  484.       Tmp$ = UIStartDlg(CUIDLL$, DLG_NEED256COLOR%, INFODLG$, 0, EMPTY$)
  485.       END
  486.    END IF
  487.  
  488. END SUB
  489.  
  490.  
  491. ''**
  492. ''**  SUB GetCDDrive
  493. ''**     Gets drive letter for CD-ROM and verifies that the CD-ROM in the
  494. ''**     drive is the correct CD.
  495. ''**
  496. ''**     At present, we don't to anything to validate that the given drive
  497. ''**     is really a CD-ROM.
  498. ''**
  499. ''**  Global inputs:
  500. ''**     None
  501. ''**
  502. ''**  Global outputs:
  503. ''**     CDDrv$
  504. ''**     CDRoot$
  505. ''**     VidTestFile$
  506. ''**
  507. STATIC SUB GetCDDrive
  508.  
  509.    SetSymbolValue "EditTextIn", MID$(GetSymbolValue("STF_SRCDIR"), 1, 1)
  510.    SetSymbolValue "EditLimit", "1"
  511.    SetSymbolValue "EditFocus", "END"
  512.  
  513. GETCD1:
  514.    Tmp$ = UIStartDlg(CUIDLL$, DLG_CDROMDRIVE%, EDITDLG$, 0, EMPTY$)
  515.    CDDrv$ = GetSymbolValue("EditTextOut")
  516.  
  517.    '' Convert to upper case.
  518.    CDDrv$ = UCASE$(CDDrv$)
  519.  
  520.    IF Tmp$ = CONTINUE$ THEN
  521.       UIPop 1
  522.    ELSE
  523.       AskQuit
  524.       GOTO GETCD1
  525.    END IF
  526.  
  527.    IF VerifyDrive(CDDrv$) THEN
  528.       Tmp$ = UIStartDlg(CUIDLL$, DLG_INVALIDDRIVE%, INFODLG$, 0, EMPTY$)
  529.       UIPop 1
  530.       IF Tmp$ = TRYAGAIN$ THEN
  531.          GOTO GETCD1
  532.       ELSE
  533.          AskQuit
  534.          GOTO GETCD1
  535.       END IF
  536.    END IF
  537.  
  538.    CDRoot$ = CDDrv$ + MID$(GetSymbolValue("STF_SRCDIR"), 2)
  539.  
  540.    VidTestFile$ = MakePath(CDRoot$, "AEROINTR.AVI")
  541.  
  542. END SUB
  543.  
  544. ''**
  545. ''**  SUB GetInstallPath
  546. ''**     Gets installation path from user, verifies it for correctness,
  547. ''**     and sets CreatPath% if it needs to be created.
  548. ''**
  549. ''**  Global inputs:
  550. ''**     DEFINSTPATH$
  551. ''**
  552. ''**  Global outputs:
  553. ''**     InstPath$
  554. ''**     HDDrv$
  555. ''**     CreatPath%
  556. ''**
  557. STATIC SUB GetInstallPath
  558.  
  559.    SetSymbolValue "EditTextIn", DEFINSTPATH$
  560.    SetSymbolValue "EditLimit", ""
  561.    SetSymbolValue "EditFocus", "END"
  562.  
  563.    CreatPath% = 0
  564.  
  565. GETPATH1:
  566.    Tmp$ = UIStartDlg(CUIDLL$, DLG_INSTPATH%, EDITDLG$, 0, EMPTY$)
  567.    InstPath$ = GetSymbolValue("EditTextOut")
  568.  
  569.    IF Tmp$ = CONTINUE$ THEN
  570.       UIPop 1
  571.    ELSE
  572.       AskQuit
  573.       GOTO GETPATH1
  574.    END IF
  575.  
  576.    ''Clean up installation path and put "\" on the end if it's not there
  577.    '' already.
  578.    InstPath$ = UCASE$(InstPath$)
  579.    I% = LEN(InstPath$)
  580.    IF I% THEN  ''Necessary because MID$() causes crash if InstPath$ is null!
  581.       IF MID$(InstPath$, I%, 1) <> "\" THEN
  582.          InstPath$ = InstPath$ + "\"
  583.       END IF
  584.    END IF
  585.  
  586. GETPATH2:
  587.    I% = VerifyPath(InstPath$)
  588.    IF I% THEN
  589.       IF I% = 1 THEN
  590.          Tmp$ = UIStartDlg(CUIDLL$, DLG_INVALIDDRIVE%, INFODLG$, 0, EMPTY$)
  591.          IF Tmp$ = TRYAGAIN$ THEN
  592.             UIPop 1
  593.             GOTO GETPATH1
  594.          ELSE
  595.             AskQuit
  596.             GOTO GETPATH2
  597.          END IF
  598.       ELSE
  599.          Tmp$ = UIStartDlg(CUIDLL$, DLG_INVALIDPATH%, INFODLG$, 0, EMPTY$)
  600.          IF Tmp$ = TRYAGAIN$ THEN
  601.             UIPop 1
  602.             GOTO GETPATH1
  603.          ELSE
  604.             AskQuit
  605.             GOTO GETPATH2
  606.          END IF
  607.       END IF
  608.    END IF
  609.  
  610. GETPATH3:
  611.    IF InstPath$ = DEFINSTPATH$ THEN
  612.       CreatPath% = -1
  613.    ELSEIF DoesDirExist(InstPath$) = 0 THEN
  614.       Tmp$ = UIStartDlg(CUIDLL$, DLG_DIRNOTFOUND%, INFODLG$, 0, EMPTY$)
  615.       IF Tmp$ = TRYAGAIN$ THEN
  616.          UIPop 1
  617.          GOTO GETPATH1
  618.       ELSEIF Tmp$ = CREATE$ THEN
  619.          UIPop 1
  620.          CreatPath% = -1
  621.       ELSE
  622.          AskQuit
  623.          GOTO GETPATH3
  624.       END IF
  625.    END IF
  626.  
  627. GETPATH4:
  628.    IF CreatPath% = 0 THEN
  629.       IF IsDirWritable(InstPath$) = 0 THEN
  630.          Tmp$ = UIStartDlg(CUIDLL$, DLG_DIRNOTWRITABLE%, INFODLG$, 0, EMPTY$)
  631.          IF Tmp$ = TRYAGAIN$ THEN
  632.             UIPop 1
  633.             GOTO GETPATH1
  634.          ELSE
  635.             AskQuit
  636.             GOTO GETPATH4
  637.          END IF
  638.       END IF
  639.    END IF
  640.  
  641.    HDDrv$ = MID$(InstPath$, 1, 1)      ''Get installation drive letter
  642.  
  643. END SUB
  644.  
  645.  
  646. ''**
  647. ''**  SUB CheckWaveDevice
  648. ''**     Tests to see if there is a Wave device available on this system.
  649. ''**
  650. ''**  Global inputs:
  651. ''**     None
  652. ''**
  653. ''**  Global outputs:
  654. ''**     None
  655. ''**
  656. STATIC SUB CheckWaveDevice
  657.    IF GetSoundCardInfo() <> GSCI_SUCCESS% THEN
  658.       Tmp$ = UIStartDlg(CUIDLL$, DLG_NEEDWAVE%, INFODLG$, 0, EMPTY$)
  659.       END
  660.    END IF
  661.  
  662. END SUB
  663.  
  664. ''**
  665. ''**  SUB UpdateWININI
  666. ''**     Updates WIN.INI if there's anything to update
  667. ''**
  668. ''**  Global inputs:
  669. ''**     EnableSkipFrames%
  670. ''**
  671. ''**  Global outputs:
  672. ''**     WinIniUpd%
  673. ''**
  674. STATIC SUB UpdateWININI
  675.  
  676.    WinIniUpd% = FALSE%
  677.  
  678.    IF EnableSkipFrames% THEN
  679.       CreateIniKeyValue "WIN.INI", "MCIAVI", "SkipFrames", "1", cmoOverwrite
  680.       WinIniUpd% = TRUE%
  681.    END IF
  682.  
  683. END SUB
  684.  
  685. ''**
  686. ''**  SUB CheckVFW11
  687. ''**     Tests to see if Video for Windows V1.1 is installed on the system.
  688. ''**     If so, we return.  If not, we exit from the installation.
  689. ''**
  690. ''**  Global inputs:
  691. ''**     None
  692. ''**
  693. ''**  Global outputs:
  694. ''**     None
  695. ''**
  696. STATIC SUB CheckVFW11
  697.  
  698.    IF GetVFWVersion(HwndFrame(), VidTestFile$) = 0 THEN
  699.       Tmp$ = UIStartDlg(CUIDLL$, DLG_NEEDVFW11%, INFODLG$, 0, EMPTY$)
  700.       END
  701.    END IF
  702.  
  703. END SUB
  704.  
  705. ''**
  706. ''**  SUB UpdateVMGroup
  707. ''**     Updates the VM items in the specified group, and updates the
  708. ''**     VMUSIC.INI "Group" entry
  709. ''**
  710. ''**  Global inputs:
  711. ''**     VMusicIniPath$
  712. ''**     Group$
  713. ''**     InstPath$
  714. ''**     CDRoot$
  715. ''**
  716. ''**  Global outputs:
  717. ''**     None
  718. ''**
  719. STATIC SUB UpdateVMGroup
  720.  
  721.    VMusicPath$ = InstPath$ + "VMUSIC.EXE " + CDRoot$ + " " + InstPath$
  722.  
  723.    CreateProgmanItem Group$, "Virtual Guitar Demo", VMusicPath$ + "LIFEDEMO.GSQ", EMPTY$, cmoOverwrite
  724.  
  725.    CreateIniKeyValue VMusicIniPath$, VGDEMO$, "Group", Group$, cmoOverwrite
  726.  
  727. END SUB
  728.  
  729. ''**
  730. ''**  SUB AskQuit
  731. ''**     See if the user really wants to exit.  If so, do it.
  732. ''**
  733. ''**  Global inputs:
  734. ''**     None
  735. ''**
  736. ''**  Global outputs:
  737. ''**     None
  738. ''**
  739. STATIC SUB AskQuit
  740.  
  741.     Tmp$ = UIStartDlg(CUIDLL$, DLG_REALLYEXIT%, "FQuitDlgProc", 0, EMPTY$)
  742.     IF Tmp$ = CONTINUE$ THEN
  743.         UIPop 1
  744.     ELSE
  745.         UIPopAll
  746.         END
  747.     END IF
  748.  
  749. END SUB
  750.  
  751. ''**
  752. ''**  SUB UpdateCDPath
  753. ''**     Updates VMUSIC.INI CDPath entry
  754. ''**
  755. ''**  Global inputs:
  756. ''**     VMusicIniPath$
  757. ''**     CDRoot$
  758. ''**
  759. ''**  Global outputs:
  760. ''**     None
  761. ''**
  762. STATIC SUB UpdateCDPath
  763.  
  764.    CreateIniKeyValue VMusicIniPath$, VGDEMO$, "CDPath", CDRoot$, cmoOverwrite
  765.  
  766. END SUB
  767.  
  768. ''**
  769. ''**  SUB UpdateInstallPath
  770. ''**     Updates VMUSIC.INI Path entry
  771. ''**
  772. ''**  Global inputs:
  773. ''**     VMusicIniPath$
  774. ''**     InstPath$
  775. ''**
  776. ''**  Global outputs:
  777. ''**     None
  778. ''**
  779. STATIC SUB UpdateInstallPath
  780.  
  781.    CreateIniKeyValue VMusicIniPath$, VGDEMO$, "Path", InstPath$, cmoOverwrite
  782.  
  783. END SUB
  784.  
  785. ''**
  786. ''**  SUB InstallVMIcons
  787. ''**     Asks the user whether to create a new Virtual Music group or
  788. ''**     install into some other group.  If user selects "some other
  789. ''**     group", a listbox is presented and the user can choose.
  790. ''**
  791. ''**     Note that if GetProgmanGroupList() returns an error, we just
  792. ''**     punt and create a Virtual Music group.
  793. ''**
  794. ''**  Global inputs:
  795. ''**     InstPath$
  796. ''**     CDRoot$
  797. ''**
  798. ''**  Global outputs:
  799. ''**     None
  800. ''**
  801. STATIC SUB InstallVMIcons
  802.  
  803.    IF GetProgmanGroupList() THEN
  804.       Group$ = VGD$
  805.       CreateProgmanGroup Group$, EMPTY$, cmoVital
  806.    ELSE
  807.       Tmp$ = UIStartDlg(CUIDLL$, DLG_PROGRAMGROUP%, INFODLG$, 0, EMPTY$)
  808.       UIPop 1
  809.       IF Tmp$ = CREATE$ THEN
  810.          SetSymbolValue "EditTextIn", VGD$
  811.          SetSymbolValue "EditLimit", "24"
  812.          SetSymbolValue "EditFocus", "END"
  813.  
  814.          Tmp$ = UIStartDlg(CUIDLL$, DLG_NEWGROUP%, EDITDLG$, 0, EMPTY$)
  815.          UIPop 1
  816.  
  817.          Group$ = GetSymbolValue("EditTextOut")
  818.  
  819.          IF Group$ = "" THEN
  820.             Group$ = VGD$
  821.          END IF
  822.  
  823.          CreateProgmanGroup Group$, EMPTY$, cmoVital
  824.       ELSE
  825.          SetSymbolValue "ListItemsOut", VGD$
  826.  
  827.          Tmp$ = UIStartDlg(CUIDLL$, DLG_SELECTGROUP%, LISTDLG$, 0, EMPTY$)
  828.          UIPop 1
  829.  
  830.          Group$ = GetSymbolValue("ListItemsOut")
  831.  
  832.          IF Group$ = "" THEN
  833.             Group$ = VGD$
  834.             CreateProgmanGroup Group$, EMPTY$, cmoVital
  835.          END IF
  836.  
  837.       END IF
  838.  
  839.    END IF
  840.  
  841.    UpdateVMGroup
  842.  
  843. END SUB
  844.  
  845.